package com.xinkao.log.util.constants;

/**
 * @author 周洋
 * @Description
 * @createTime 2021/9/03 9:28
 */
public enum LogEnum {

    /**
     * 参数字段转换
     */
    STU_ID("stuId","学生id"),
    GRADE_NAME("gradeName","年级"),
    GRADE_ID("gradeId","年级id"),
    SCHOOL_ID("schoolId","学校id"),
    CLASS_NAME("className","班级名称"),


    LOGIN_NAME("loginName","登录名"),
    ROLE_ID("roleId","角色id"),
    USER_NAME("userName","用户名"),
    IS_REV("isRev","是否有综评权限0是1否"),
    STU_CLASS("stuClass","综评班级（json）"),
    TEACH_CLASS("teachClass","任教班级（json）"),
    TEACH_SUBJECT("teachSubject","任教科目"),
    HEAD_TEACHER("headTeacher","是否为班主任0是1否"),
    IS_SUPER("isSuper","是否超级管理员（1是；0否）"),
    SEMESTER("semester","学期"),
    SEMESTER_START("semesterStart","起止年份"),
    SEMESTER_END("semesterEnd","结束年份"),
    ROLE_NAME("roleName","角色名称"),
    PERMISSION_IDS("permissionIds","全选中角色id"),
    OPERATOR("operator","操作人"),
    OPERATOR_START_TIME("operatingStartTime","开始时间"),
    OPERATOR_END_TIME("operatingEndTime","结束时间"),
    NAME("name","名称"),
    KEY_INDEX("keyIndex","关键指标"),
    STANDARD("standard","评价标准"),
    PARENT_ID("parentId","父级id0为内容其他为指标"),
    CONTENT("content","内容名称"),
    ACADEMIC("academic","学生学业指标（数组id）"),
    CREATE_BY("createBy","创建人"),
    CREATE_TIME("createTime","创建时间"),
    DELETE_STATUS("deleteStatus","删除状态1删除0未删除"),
    UPDATE_BY("updateBy","更新人"),
    PHYSICAL("physical","学生体能指标（数组id）"),
    OVERVIEW("overview","综合评价内容（数组id）"),
    UPDATE_TIME("updateTime","修改时间"),
    SEMESTER_ID("semesterId","所属学期id"),
    REV_TYPE("revType","综评方式0线上1线下"),
    SCHOOL_IDS("schoolIds","学校id组"),
    SCORE("score","分数"),
    SCORE_A("scoreA","评分等级A"),
    SCORE_B("scoreB","评分等级B"),
    SCORE_C("scoreC","评分等级C"),
    SCORE_D("scoreD","评分等级D"),
    EVALUATION_PLAN("evaluationPlan","综评方案id"),
    DEAD_LINE("deadline","截止时间"),
    TABLE_INFO("tableInfo","表格数据"),
    OWN_WEIGH("ownWeigh","学生自评权重"),
    TEA_WEIGH("teaWeigh","老师评价权重"),
    STU_WEIGH("stuWeigh","学生互评权重"),
    CHILD_SCORE("childScore","关键指标分值"),
    SCORING_CRITERIA("scoringCriteria","评分标准"),
    OVERVIEW_ID("overviewId","综合评价指标内容id"),
    CHILD_OVERVIEW_ID("childOverviewId","综合评价关键指标id"),
    FAIL_REASON("failReason","打回原因"),
    CASE_NAME("caseName","打回原因"),
    EVALUATION_CONTENT("evaluationContent","打回原因"),
    EVALUATION_INDEX("evaluationIndex","打回原因"),
    CASE_START("caseStart","打回原因"),
    CASE_END("caseEnd","打回原因"),
    CASE_DESCRIBE("caseDescribe","打回原因"),
    SELF_EVALUATION("selfEvaluation","自我评价"),
    PARENT_EVALUATION("parentEvaluation","父母评价"),
    STU_INFO("stuInfo","学生信息"),
    STU_NAME("stuName","学生姓名"),
    STU_NUMBER("stuNumber","学籍号"),
    COVER("cover","重复数据处理0覆盖原有数据1不进行处理"),
    STAGE("stage","选择阶段0期中1期末"),
    PASSWORD("password","密码"),
    OLD_PASSWORD("oldPassword","旧密码"),
    NEW_PASSWORD("newPassword","新密码"),

    PROVINCE_NAME("provinceName","学校所在省名称"),
    PROVINCE("province","学校所在省code"),
    PHONE("phon","联系方式"),
    PRINCIPAL_NAME("principalName","负责人姓名"),
    SCHOOL_NATURE("schoolNature","学校性质0公办1民办"),
    SCHOOL_NAME("schoolName","学校名称"),
    ORG_ID("orgId","机构id"),
    CITY("city","学校所在市code"),
    CITY_NAME("cityName","学校所在市名称"),
    COUNTRY("country","户口所在区县code"),
    COUNTRY_NAME("countryName","户口所在区县名称"),
    ADDRESS("address","户口所在地址详情"),
    REMARK("remark","备注信息"),
    STATUS("status","学校状态0有效1无效"),
    ID("id","主键id");

    private String column;
    private String message;

    private LogEnum(String column, String message) {
        this.column = column;
        this.message = message;
    }

    public String getColumn() {
        return column;
    }

    public void setColumn(String column) {
        this.column = column;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static LogEnum match(String column) {

        LogEnum result = null;

        for (LogEnum s : values()) {
            if (s.getColumn().equals(column)) {
                result = s;
                break;
            }
        }

        return result;
    }

    public static LogEnum catchMessage(String msg) {

        LogEnum result = null;

        for (LogEnum s : values()) {
            if (s.getMessage().equals(msg)) {
                result = s;
                break;
            }
        }

        return result;
    }
}
